package cn.dliyy.warehouse.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.dliyy.base.dao.HQL;
import cn.dliyy.warehouse.bean.Company;
import cn.dliyy.warehouse.dao.EntityDao;

@Service
public class CompanyService {
	@Resource
	private EntityDao entityDao;
	@Resource
	private HQL hql;

	@Transactional
	public List<Object> getCompanyList() {
		//StringBuffer sff = new StringBuffer();
		//sff.append("select a from ").append(Company.class.getSimpleName()).append(" a ");
		List<Object> list = entityDao.createQuery(hql.getListHQL(Company.class).toString());
		return list;
	}

	public void save(Company cp) {
		entityDao.save(cp);
	}

	public void delete(Object obj) {
		entityDao.delete(obj);
	}
}
